<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@ include file="/admin/include/init_admin.jsp" %>
<%@ page import="com.joinhawaii.admin.sales.*" %>
<%


	HashList codeEnjoy	= CommonUtil.getCodeList("enjoy", "선택");	//선택관광

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>조인하와이</title>
	<%@ include file="/admin/include/cssnjs.jsp"  %>
	<script type="text/javascript">
	$(document).ready(function() {

		$('#list').find('tr').hover(
				function () { $(this).addClass("over"); }
			  , function () { $(this).removeClass("over"); }
			);
	});

	
	function fnOpenVoucher(gubn) {
		if (gubn == 'fly') {
			cfOpen('/home/voucher/flyVoucher.jsp?est_no=0&est_seq=1', '조인하와이', 900, 600);
		}
		else if (gubn == 'enjoy') {
			if ($('#enjoy_id').val() == "") {
				alert('상품을 선택하세요');
			} else {
				$.ajax({
					url: '/admin/sales/voucherPrintSave.do',
					type: "POST",
				    dataType: 'json',//html,text,json
				    data: { //파라미터
				    	enjoy_id : $('#enjoy_id').val()
				    },
				    error: function(data, status, err){
				    	alert(err);
				    },
					success: function(data){
						cfOpen('/home/voucher/enjoyVoucher.jsp?est_no=0&est_seq=1', '조인하와이', 900, 600);
				    }
				});
			}
		}
		else if (gubn == 'hertz') {
			cfOpen('/home/voucher/carVoucher.jsp?est_no=0&est_seq=1', '조인하와이', 900, 600);
		}
		else if (gubn == 'alamo') {
			cfOpen('/home/voucher/carVoucher.jsp?est_no=0&est_seq=2', '조인하와이', 900, 600);
		}
		else if (gubn == 'hotel') {
			cfOpen('/home/voucher/hotelVoucher.jsp?est_no=0&est_seq=1', '조인하와이', 900, 600);
		}
	}

	</script>
</head>
<body>
<div id="wrap">
	<div id="top">
		<%@ include file="/admin/include/top.jsp" %>
	</div>
	<div id="page">
		<div id="menu">
			<%@ include file="/admin/include/leftMenu.jsp" %>
		</div>
		<div id="contents">
			<div class="menu_title">
				<h1>바우처출력</h1>
				<p>관리자 > 견적관리 > <b>바우처출력</b></p>
			</div>
			<div class="clear line_01"></div>

			<br/>
			<br/>

		    <table cellpadding="0" cellspacing="0" class="table_03">
				<colgroup>
					<col width="80px"/>
					<col width="200px"/>
					<col width="300px"/>
					<col/>
				</colgroup>
				<thead>
					<tr>
						<th><p>No</p></th>
						<th colspan="2"><p>바우처명</p></th>
						<th><p></p></th>
					</tr>
				</thead>
				<tbody id="list">
					<tr>
						<td>1</td>
						<td class="l">주내선 바우처</td>
						<td class="l"></td>
						<td class="l"><a href="#nohref" onclick="fnOpenVoucher('fly')"><img src="/images/admin/btn_print.gif"/></a></td>
					</tr>
					<tr>
						<td class="no">2</td>
						<td class="l">선택관광 바우처</td>
						<td class="l">
							<select name="enjoy_id" id="enjoy_id" class="w240" onchange="fnChangeEnjoy()">
								<%= StringUtil.makeOptionByGroup(codeEnjoy, "") %>
							</select>
						</td>
						<td class="l"><a href="#nohref" onclick="fnOpenVoucher('enjoy')"><img src="/images/admin/btn_print.gif"/></a></td>
					</tr>
					<tr>
						<td class="no">3</td>
						<td class="l">렌터카 바우처 - HERTZ</td>
						<td class="l"></td>
						<td class="l"><a href="#nohref" onclick="fnOpenVoucher('hertz')"><img src="/images/admin/btn_print.gif"/></a></td>
					</tr>
					<tr>
						<td class="no">4</td>
						<td class="l">렌터카 바우처 - ALAMO</td>
						<td class="l"></td>
						<td class="l"><a href="#nohref" onclick="fnOpenVoucher('alamo')"><img src="/images/admin/btn_print.gif"/></a></td>
					</tr>
					<tr>
						<td class="no">5</td>
						<td class="l">호텔 바우처</td>
						<td class="l"></td>
						<td class="l"><a href="#nohref" onclick="fnOpenVoucher('hotel')"><img src="/images/admin/btn_print.gif"/></a></td>
					</tr>
				</tbody>
			</table>

		</div>
	</div>
</div>
</body>
</html>
